// 库存管理筛选值
export const demoSearchSelect = (data, value) => {
  const {
    barcode, //条码
    batch, //批次
    brand, //品牌
    class_one, //一级类目
    class_two, //二级类目
    goods_name, //产品名称
    in_order_type, //入库类型
    inventory_check_type, //盘点方案
    inventory_status, //状态
    out_order_type, //出库类型
    out_status, //出库状态
    series, //系列
    spec_no, //编码
    wms_owner, //货主
    wms_warehouse, //仓库
    type_all_name, //业务类型
  } = data;

  if (value == "owner_no" || value == "warehouse_no") {
    return wms_owner.map((item) => {
      return { value: item.owner_no, label: item.short_name };
    });
  }
  if (value == "batch_no") {
    return batch.map((item) => {
      return {
        value: item.batch_no != "空" ? item.batch_no : "0",
        label: item.batch_no,
      };
    });
  }
  if (value == "status") {
    return out_status.map((item) => {
      return { value: item.id, label: item.name };
    });
  }
  if (value == "make_status") {
    return inventory_status.map((item) => {
      return { value: item.id, label: item.name };
    });
  }
  if (value == "src_order_type") {
    return out_order_type.map((item) => {
      return { value: item.id, label: item.name };
    });
  }
  if (value == "src_order_type_in") {
    return in_order_type.map((item) => {
      return { value: item.id, label: item.name };
    });
  }
  if (value == "check_type") {
    return inventory_check_type.map((item) => {
      return { value: item.id, label: item.name };
    });
  }
  if (value == "assistant_id") {
    return brand.map((item) => {
      return { value: item.entry_id, label: item.name };
    });
  }
  if (value == "class_id1") {
    return class_one.map((item) => {
      return { value: item.id, label: item.data_title };
    });
  }
  if (value == "class_id2") {
    return class_two.map((item) => {
      return { value: item.id, label: item.data_title };
    });
  }
  if (value == "xl_id") {
    return series.map((item) => {
      return { value: item.id, label: item.data_title };
    });
  }
  if (value == "barcode") {
    return barcode.map((item) => {
      return { value: item.barcode, label: item.barcode };
    });
  }
  if (value == "number") {
    return spec_no.map((item) => {
      return { value: item.spec_no, label: item.spec_no };
    });
  }
  if (value == "name") {
    return goods_name.map((item) => {
      return { value: item.goods_name, label: item.goods_name };
    });
  }
  if (value == "type_name") {
    return type_all_name.map((item) => {
      return { value: item.name, label: item.name };
    });
  }
  if (value == "wms_warehouse") {
    return wms_warehouse.map((item) => {
      return { value: item.warehouse_no, label: item.name };
    });
  }
  return [];
};

// 查询项
export const demoSearch = [
  { label: "工号", prop: "workNo", type: "input" },
  { label: "登录账号", prop: "username", type: "input" },
  { label: "真实姓名", prop: "realname", type: "input" },
  { label: "性别", prop: "sex", type: "select" },
  { label: "职务", prop: "post", type: "select" },
  { label: "电话", prop: "phone", type: "input" },
  { label: "负责部门", prop: "departIds", type: "select" },
  { label: "状态", prop: "status", type: "select" },
];
// 表格字段展示
export const demoCloums = [
  { label: "工号", prop: "workNo", width: "160" },
  { label: "登录账号", prop: "username", width: "140" },
  { label: "真实姓名", prop: "realname", width: "90" },
  { label: "性别", prop: "sex", type: "custom" },
  { label: "职务", prop: "post" },
  { label: "电话", prop: "phone", width: "120", type: "custom" },
  { label: "头像", prop: "avatar", width: "120", type: "custom" },
  { label: "负责部门", prop: "departIds", width: "100", type: "" },
  { label: "座机号", prop: "telephone", type: "", width: "100" },
  { label: "状态", prop: "status", width: "100", type: "custom" },
];
